/* eslint-disable array-callback-return */
/* eslint-disable no-param-reassign */
/* eslint-disable react/jsx-indent */
/* eslint-disable no-redeclare */
/* eslint-disable no-var */
/* eslint-disable block-scoped-var */
/* eslint-disable vars-on-top */
/* eslint-disable react/destructuring-assignment */
/* eslint-disable eqeqeq */
/* eslint-disable react/no-unused-state */
import React, { PureComponent } from 'react';
import { Button, Col, Row, message, Modal, Spin, Tabs, Form } from 'antd';
// eslint-disable-next-line no-unused-vars
import _ from 'lodash';
import moment from 'moment';
import { nsAxios } from '../../utils/utils';
import styles from './index.less';
// import LocalPolicy from './index.js';

const { TabPane } = Tabs;
const FormItem = Form.Item;
class PolicyDetail extends PureComponent {
  // 组件内所有数据的初始状态
  constructor(props) {
    super(props);
    this.state = {
      loading: false,
      iInsobj: {},
      categoryList: [],
      dictionaries: ['BIZ_INS_TYPE'],
      BIZ_INS_TYPE: [],
      categoryOne: {},
      detailData: [],
      objDetail: {},
      messagedetailOne: {},
      areaId: '',
      plcyId: '',
      insLsCode: '',
      categoryid: '',
      accuOrIns: '',
    };
  }

  componentDidMount = () => {
    const { plcyId, accuOrIns, areaId } = this.props;
    this.setState({
      areaId,
      plcyId,
      accuOrIns,
    });
    if (accuOrIns == 1) {
      // 社保
      this.getInsPlcy(plcyId, areaId);
    } else if (accuOrIns == 2) {
      // 公积金
      this.getAccuPlcy(plcyId);
    }

    nsAxios('/mdm/nmDict/queryDictItemsByCodes', this.state.dictionaries)
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          this.setState({
            BIZ_INS_TYPE: res.data.BIZ_INS_TYPE,
            insLsCode: res.data.BIZ_INS_TYPE[0].itemCode,
          });
        } else {
          // message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });

    nsAxios('/joinIde/list', { areaId })
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          if (res.data.length) {
            this.setState({
              categoryid: res.data[0].ideId,
            });
          }
        } else {
          message.warning(`${res.message || '获取社保政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  // 获取公积金政策
  getAccuPlcy = plcyId => {
    nsAxios('/accuLsPkg/queryLocStdInfo', { accuLsPkgId: plcyId })
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          if (res.data[0]) {
            res.data[0].active = true;
          }

          this.setState({
            // categoryList: res.data,
            detailData: res.data,
            messagedetailOne: res.data[0],
          });
        } else {
          message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
    nsAxios('/accuLsPkg/getAccuLsPkg', { accuLsPkgId: plcyId })
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          this.setState({
            // categoryList: res.data,
            iInsobj: res.data,
          });
        } else {
          message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  // 切换险种
  bizTabChange = value => {
    this.setState({
      insLsCode: value,
    });
    if (this.state.iInsobj.hshdRegFlag == '2') {
      // eslint-disable-next-line vars-on-top
      // eslint-disable-next-line prefer-const
      let parame = {
        insLsPkgId: this.state.plcyId,
        // joinIdeId: res.data[0].ideId,
        type: value,
      };
      nsAxios('/insLsPkg/queryLocStd', parame).then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          res.data[0].active = true;
          this.setState({
            detailData: res.data,
            messagedetailOne: res.data[0],
            beginDate: res.data[0] ? res.data[0].beginDate : '',
          });
          this.dateSelect(res.data[0] ? res.data[0].beginDate : '');
        } else {
          // message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      });
    } else {
      this.cateContri(this.state.areaId, this.state.plcyId);
    }
  };

  // 获取社保政策
  getInsPlcy = (plcyId, areaId) => {
    nsAxios('/insLsPkg/getInsLsPkg', { insLsPkgId: plcyId })
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          this.setState({
            iInsobj: res.data,
          });

          if (res.data.hshdRegFlag == '2') {
            // eslint-disable-next-line prefer-const
            let parame = {
              insLsPkgId: plcyId,
              // joinIdeId: res.data[0].ideId,
              type: this.state.insLsCode || '3',
            };
            // eslint-disable-next-line no-shadow
            nsAxios('/insLsPkg/queryLocStd', parame).then(res => {
              this.setState({ loading: false });
              // eslint-disable-next-line no-empty
              if (res.success) {
                res.data[0].active = true;
                this.setState({
                  detailData: res.data,
                  messagedetailOne: res.data[0],
                  beginDate: res.data[0] ? res.data[0].beginDate : '',
                });
                this.dateSelect(res.data[0] ? res.data[0].beginDate : '');
              } else {
                // message.warning(`${res.message || '获取公积金政策失败！'}`);
              }
            });
          } else {
            this.cateContri(areaId, plcyId);
          }
        } else {
          message.warning(`${res.message || '获取社保政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  // 获取缴费人员类别
  cateContri = (areaId, plcyId) => {
    nsAxios('/joinIde/list', { areaId })
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          this.setState({
            categoryList: res.data,
          });
          this.detailMeaage(plcyId);
          if (res.data.length > 0) {
            this.setState({
              categoryOne: res.data[0],
            });
          }
        } else {
          message.warning(`${res.message || '获取社保政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  detailMeaage = plcyId => {
    if (this.state.iInsobj.hshdRegFlag == '2') {
      // eslint-disable-next-line vars-on-top
      // eslint-disable-next-line no-var
      var parame = {
        insLsPkgId: plcyId,
        // joinIdeId: res.data[0].ideId,
        type: this.state.insLsCode || '3',
      };
    } else {
      var parame = {
        insLsPkgId: plcyId,
        joinIdeId: this.state.categoryid,
        type: this.state.insLsCode || '3',
      };
    }

    nsAxios('/insLsPkg/queryLocStd', parame)
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          res.data[0].active = true;
          this.setState({
            detailData: res.data,
            messagedetailOne: res.data[0],
            beginDate: res.data[0] ? res.data[0].beginDate : '',
          });
          this.dateSelect(res.data[0] ? res.data[0].beginDate : '');
        } else {
          // message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  dateSelect = value => {
    let tempData = {};
    // eslint-disable-next-line no-unused-vars
    this.state.detailData.map((item, index) => {
      if (item.beginDate == value) {
        tempData = item;
      }
    });
    this.setState({
      objDetail: tempData,
      beginDate: value,
    });
    // this.setState({

    // })
  };

  ideTabChange = value => {
    this.setState({
      categoryid: value,
      // insLsCode: '3',
    });
    if (this.state.iInsobj.hshdRegFlag == '2') {
      var parame = {
        insLsPkgId: this.state.plcyId,
        // joinIdeId: res.data[0].ideId,
        type: this.state.insLsCode || '3',
      };
    } else {
      var parame = {
        insLsPkgId: this.state.plcyId,
        joinIdeId: value,
        type: this.state.insLsCode || '3',
      };
    }

    nsAxios('/insLsPkg/queryLocStd', parame)
      .then(res => {
        this.setState({ loading: false });
        // eslint-disable-next-line no-empty
        if (res.success) {
          res.data[0].active = true;
          this.setState({
            detailData: res.data,
            messagedetailOne: res.data[0],
            beginDate: res.data[0] ? res.data[0].beginDate : '',
          });
          this.dateSelect(res.data[0] ? res.data[0].beginDate : '');
        } else {
          // message.warning(`${res.message || '获取公积金政策失败！'}`);
        }
      })
      .catch(err => {
        // eslint-disable-next-line no-console
        console.log(err);
      });
  };

  isShow = () => {
    this.props.cancelPolicyModal(false);
  };

  // 点击查看右侧的
  onTimeButton = timeitem => {
    // eslint-disable-next-line no-unused-vars
    this.state.detailData.map((item, index) => {
      if (item.locStdId == timeitem.locStdId) {
        item.active = true;
      } else {
        item.active = false;
      }
    });
    // eslint-disable-next-line react/no-access-state-in-setstate
    const newdetailData = this.state.detailData;
    this.setState({
      detailData: newdetailData,
      messagedetailOne: timeitem,
    });
  };

  render() {
    // 引入组件构造属性
    const formItemLayout = {
      labelCol: { md: { span: 11 } },
      wrapperCol: { md: { span: 12 } },
    };
    const modelLayout = {
      title: '查看详情',
      visible: true,
      style: { marginTop: 10 },
      footer: null,
      onCancel: () => {
        // eslint-disable-next-line react/destructuring-assignment
        // this.props.cancelPolicyModal('false');
        this.isShow();
      },
    };
    const {
      iInsobj,
      categoryList,
      BIZ_INS_TYPE,
      detailData,
      messagedetailOne,
      accuOrIns,
    } = this.state;
    return (
      // eslint-disable-next-line react/destructuring-assignment
      // <Fragment style={{ margin: '16px 0 0 0' }}>
      <Form name="PolicyDetailForm" {...formItemLayout}>
        <Spin tip="Loading..." spinning={this.state.loading}>
          <Modal {...modelLayout} width={1000}>
            <Row>
              {accuOrIns == '1' ? (
                <Col span={12}>
                  <FormItem label="组合名称">
                    <span>{iInsobj && iInsobj.insLsPkgName ? iInsobj.insLsPkgName : '--'}</span>
                  </FormItem>
                </Col>
              ) : (
                <Col span={12}>
                  <FormItem label="组合名称">
                    <span>{iInsobj && iInsobj.accuLsPkgName ? iInsobj.accuLsPkgName : '--'}</span>
                  </FormItem>
                </Col>
              )}

              {accuOrIns == '1' ? (
                <Col span={12}>
                  <FormItem label="是否区分缴费人员类别">
                    <span>
                      {iInsobj && iInsobj.hshdRegFlagName ? iInsobj.hshdRegFlagName : '--'}
                    </span>
                  </FormItem>
                </Col>
              ) : null}
            </Row>

            {iInsobj && iInsobj.hshdRegFlag == '1' ? (
              <Tabs
                defaultActiveKey={categoryList[0] ? categoryList[0].ideId : ''}
                onChange={this.ideTabChange}
                type="card"
              >
                {categoryList.map(value => (
                  <TabPane tab={value.ideName} key={value.ideId}>
                    <Row style={{ height: '54px', background: '#fafafa' }}>
                      <Col
                        style={{
                          width: '200px',
                          height: '54px',
                          lineHeight: '54px',
                          fontWeight: '900',
                          float: 'left',
                          textAlign: 'center',
                        }}
                      >
                        政策类型
                      </Col>
                      <Col
                        style={{
                          width: '200px',
                          height: '54px',
                          lineHeight: '54px',
                          fontWeight: '900',
                          float: 'left',
                          textAlign: 'center',
                        }}
                      >
                        生效年月
                      </Col>
                      <Col
                        style={{
                          width: '200px',
                          height: '54px',
                          lineHeight: '54px',
                          fontWeight: '900',
                          float: 'left',
                          textAlign: 'left',
                          padding: '0 0 0 20px',
                        }}
                      >
                        政策信息
                      </Col>
                    </Row>

                    <Row>
                      <Col style={{ width: '200px', float: 'left' }}>
                        <Tabs
                          activeKey={this.state.insLsCode || '3'}
                          tabPosition="left"
                          onChange={this.bizTabChange}
                          tabBarStyle={{
                            width: '200px',
                            margin: '20px 0 0 0',
                          }}
                          className="tabsstyle"
                        >
                          {BIZ_INS_TYPE
                            ? BIZ_INS_TYPE.map(bizItem => (
                                // eslint-disable-next-line react/jsx-indent
                                <TabPane
                                  className="tabPanestyle"
                                  tab={bizItem.itemName}
                                  key={bizItem.itemCode}
                                />
                              ))
                            : null}
                        </Tabs>
                      </Col>

                      <Col style={{ width: '180px', float: 'left', background: '#fafafa' }}>
                        <Col
                          style={{
                            height: 300,
                            minHeight: 300,
                            lineHeight: '25px',
                            overflow: 'hidden',
                            overflowY: 'scroll',
                          }}
                        >
                          {detailData.length == 0
                            ? null
                            : // eslint-disable-next-line no-unused-vars
                              detailData.map((timeitem, itemindex) => (
                                // eslint-disable-next-line react/jsx-indent
                                // <div style={{ background: '#fafafa' }}>
                                <div
                                  key={timeitem.locStdId + timeitem.beginDate}
                                  style={{ background: '#fafafa' }}
                                >
                                  <div
                                    className={
                                      timeitem.active ? styles.activeButton : styles.noActiveButton
                                    }
                                    onClick={() => this.onTimeButton(timeitem, 1)}
                                    style={{
                                      marginRight: 5,
                                      marginTop: 10,
                                      height: '48px',
                                      lineHeight: '48px',
                                      float: 'left',
                                      width: '200px',
                                      padding: '0 0 0 60px',
                                      cursor: 'pointer',
                                    }}
                                  >
                                    <span style={{ float: 'left' }}>
                                      {moment(timeitem.beginDate).format('YYYY-MM')}
                                    </span>
                                  </div>
                                </div>
                              ))}
                        </Col>
                      </Col>
                      <Col span={14} style={{ loat: 'left', margin: '0 0 0 15px' }}>
                        <Row>
                          <Col span={12}>
                            <FormItem {...formItemLayout} label="企业基数上限">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.corpBaseUprLmt == 0 ? (
                                      <span>{messagedetailOne.corpBaseUprLmt}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.corpBaseUprLmt
                                          ? messagedetailOne.corpBaseUprLmt
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                          <Col span={12}>
                            <FormItem label="个人基数上限">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.empBaseUprLmt == 0 ? (
                                      <span>{messagedetailOne.empBaseUprLmt}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.empBaseUprLmt
                                          ? messagedetailOne.empBaseUprLmt
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row>
                          <Col span={12}>
                            <FormItem label="企业基数下限">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.corpBaseLwrLmt == 0 ? (
                                      <span>{messagedetailOne.corpBaseLwrLmt}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.corpBaseLwrLmt
                                          ? messagedetailOne.corpBaseLwrLmt
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                          <Col span={12}>
                            <FormItem label="个人基数下限">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.empBaseLwrLmt == 0 ? (
                                      <span>{messagedetailOne.empBaseLwrLmt}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.empBaseLwrLmt
                                          ? messagedetailOne.empBaseLwrLmt
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                        </Row>

                        <Row>
                          <Col span={12}>
                            <FormItem label="企业基数进位规则">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.corpBaseCarryRuleName == 0 ? (
                                      <span>{messagedetailOne.corpBaseCarryRuleName}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.corpBaseCarryRuleName
                                          ? messagedetailOne.corpBaseCarryRuleName
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                          <Col span={12}>
                            <FormItem label="个人基数进位规则">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.empBaseCarryRuleName == 0 ? (
                                      <span>{messagedetailOne.empBaseCarryRuleName}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.empBaseCarryRuleName
                                          ? messagedetailOne.empBaseCarryRuleName
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                        </Row>

                        <Row>
                          <Col span={12}>
                            <FormItem label="企业缴费比例">
                              <Col span={10}>
                                <span>
                                  {messagedetailOne ? (
                                    <div>
                                      {messagedetailOne.corpProp == 0 ? (
                                        <span>{messagedetailOne.corpProp}</span>
                                      ) : (
                                        <span>
                                          {messagedetailOne.corpProp
                                            ? messagedetailOne.corpProp
                                            : null}
                                        </span>
                                      )}
                                    </div>
                                  ) : null}
                                </span>
                              </Col>
                              <Col span={1} offset={1}>
                                %
                              </Col>
                            </FormItem>
                          </Col>

                          <Col span={12}>
                            <FormItem label="个人缴费比例">
                              <Col span={10}>
                                <span>
                                  {messagedetailOne ? (
                                    <div>
                                      {messagedetailOne.empProp == 0 ? (
                                        <span>{messagedetailOne.empProp}</span>
                                      ) : (
                                        <span>
                                          {messagedetailOne.empProp
                                            ? messagedetailOne.empProp
                                            : null}
                                        </span>
                                      )}
                                    </div>
                                  ) : null}
                                </span>
                              </Col>
                              <Col span={1} offset={1}>
                                %
                              </Col>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row>
                          <Col span={12}>
                            <FormItem label="企业固定金额">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.corpFixSum == 0 ? (
                                      <span>{messagedetailOne.corpFixSum}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.corpFixSum
                                          ? messagedetailOne.corpFixSum
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                          <Col span={12}>
                            <FormItem label="个人固定金额">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.empFixSum == 0 ? (
                                      <span>{messagedetailOne.empFixSum}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.empFixSum
                                          ? messagedetailOne.empFixSum
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                        </Row>
                        <Row>
                          <Col span={12}>
                            <FormItem label="企业缴费进位规则">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.corpCarryRuleName == 0 ? (
                                      <span>{messagedetailOne.corpCarryRuleName}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.corpCarryRuleName
                                          ? messagedetailOne.corpCarryRuleName
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                          <Col span={12}>
                            <FormItem label="个人缴费进位规则">
                              <span>
                                {messagedetailOne ? (
                                  <div>
                                    {messagedetailOne.empCarryRuleName == 0 ? (
                                      <span>{messagedetailOne.empCarryRuleName}</span>
                                    ) : (
                                      <span>
                                        {messagedetailOne.empCarryRuleName
                                          ? messagedetailOne.empCarryRuleName
                                          : null}
                                      </span>
                                    )}
                                  </div>
                                ) : null}
                              </span>
                            </FormItem>
                          </Col>
                        </Row>

                        <Row>
                          <Col span={12}>
                            <FormItem label="政府发文时间">
                              {messagedetailOne ? (
                                <span>
                                  {messagedetailOne.govPostTime
                                    ? moment(messagedetailOne.govPostTime).format(
                                        'YYYY-MM-DD HH:mm'
                                      )
                                    : null}
                                </span>
                              ) : null}
                            </FormItem>
                          </Col>
                          <Col span={12} />
                        </Row>
                      </Col>
                    </Row>
                  </TabPane>
                ))}
              </Tabs>
            ) : (
              <div>
                <Row style={{ height: '54px', background: '#fafafa' }}>
                  {accuOrIns == '1' ? (
                    <Col
                      style={{
                        width: '200px',
                        height: '54px',
                        lineHeight: '54px',
                        fontWeight: '900',
                        float: 'left',
                        textAlign: 'center',
                      }}
                    >
                      政策类型
                    </Col>
                  ) : null}

                  <Col
                    style={{
                      width: '200px',
                      height: '54px',
                      lineHeight: '54px',
                      fontWeight: '900',
                      float: 'left',
                      textAlign: 'center',
                    }}
                  >
                    生效年月
                  </Col>
                  <Col
                    style={{
                      width: '200px',
                      height: '54px',
                      lineHeight: '54px',
                      fontWeight: '900',
                      float: 'left',
                      textAlign: 'left',
                      padding: '0 0 0 20px',
                    }}
                  >
                    政策信息
                  </Col>
                </Row>

                <Row>
                  {accuOrIns == '1' ? (
                    <Col style={{ width: '200px', float: 'left' }}>
                      <Tabs
                        // activeKey={BIZ_INS_TYPE}
                        tabPosition="left"
                        activeKey={this.state.insLsCode || '3'}
                        onChange={this.bizTabChange}
                        tabBarStyle={{
                          width: '200px',
                          margin: '20px 0 0 0',
                        }}
                        className="tabsstyle"
                      >
                        {BIZ_INS_TYPE
                          ? BIZ_INS_TYPE.map(bizItem => (
                              // eslint-disable-next-line react/jsx-indent
                              <TabPane
                                className="tabPanestyle"
                                tab={bizItem.itemName}
                                key={bizItem.itemCode}
                              />
                            ))
                          : null}
                      </Tabs>
                    </Col>
                  ) : null}

                  <Col style={{ width: '180px', float: 'left', background: '#fafafa' }}>
                    <Col
                      style={{
                        height: 300,
                        minHeight: 300,
                        lineHeight: '25px',
                        overflow: 'hidden',
                        overflowY: 'scroll',
                      }}
                    >
                      {detailData.length == 0
                        ? null
                        : // eslint-disable-next-line no-unused-vars
                          detailData.map((timeitem, itemindex) => (
                            // eslint-disable-next-line react/jsx-indent
                            <div
                              key={timeitem.locStdId + timeitem.beginDate}
                              style={{ background: '#fafafa' }}
                            >
                              <div
                                className={
                                  timeitem.active ? styles.activeButton : styles.noActiveButton
                                }
                                onClick={() => this.onTimeButton(timeitem, 1)}
                                style={{
                                  marginRight: 5,
                                  marginTop: 10,
                                  height: '48px',
                                  lineHeight: '48px',
                                  float: 'left',
                                  width: '200px',
                                  padding: '0 0 0 60px',
                                  cursor: 'pointer',
                                }}
                              >
                                <span style={{ float: 'left' }}>
                                  {moment(timeitem.beginDate).format('YYYY-MM')}
                                </span>
                              </div>
                            </div>
                          ))}
                    </Col>
                  </Col>
                  <Col span={14} style={{ loat: 'left', margin: '0 0 0 15px' }}>
                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业基数上限">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.corpBaseUprLmt == 0 ? (
                                  <span>{messagedetailOne.corpBaseUprLmt}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.corpBaseUprLmt
                                      ? messagedetailOne.corpBaseUprLmt
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人基数上限">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.empBaseUprLmt == 0 ? (
                                  <span>{messagedetailOne.empBaseUprLmt}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.empBaseUprLmt
                                      ? messagedetailOne.empBaseUprLmt
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业基数下限">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.corpBaseLwrLmt == 0 ? (
                                  <span>{messagedetailOne.corpBaseLwrLmt}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.corpBaseLwrLmt
                                      ? messagedetailOne.corpBaseLwrLmt
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人基数下限">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.empBaseLwrLmt == 0 ? (
                                  <span>{messagedetailOne.empBaseLwrLmt}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.empBaseLwrLmt
                                      ? messagedetailOne.empBaseLwrLmt
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                    </Row>

                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业基数进位规则">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.corpBaseCarryRuleName == 0 ? (
                                  <span>{messagedetailOne.corpBaseCarryRuleName}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.corpBaseCarryRuleName
                                      ? messagedetailOne.corpBaseCarryRuleName
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人基数进位规则">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.empBaseCarryRuleName == 0 ? (
                                  <span>{messagedetailOne.empBaseCarryRuleName}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.empBaseCarryRuleName
                                      ? messagedetailOne.empBaseCarryRuleName
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                    </Row>

                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业缴费比例">
                          <Col span={10}>
                            <span>
                              {messagedetailOne ? (
                                <div>
                                  {messagedetailOne.corpProp == 0 ? (
                                    <span>{messagedetailOne.corpProp}</span>
                                  ) : (
                                    <span>
                                      {messagedetailOne.corpProp ? messagedetailOne.corpProp : null}
                                    </span>
                                  )}
                                </div>
                              ) : null}
                            </span>
                          </Col>
                          <Col span={1} offset={1}>
                            %
                          </Col>
                        </FormItem>
                      </Col>

                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人缴费比例">
                          <Col span={10}>
                            <span>
                              {messagedetailOne ? (
                                <div>
                                  {messagedetailOne.empProp == 0 ? (
                                    <span>{messagedetailOne.empProp}</span>
                                  ) : (
                                    <span>
                                      {messagedetailOne.empProp ? messagedetailOne.empProp : null}
                                    </span>
                                  )}
                                </div>
                              ) : null}
                            </span>
                          </Col>
                          <Col span={1} offset={1}>
                            %
                          </Col>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业固定金额">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.corpFixSum == 0 ? (
                                  <span>{messagedetailOne.corpFixSum}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.corpFixSum
                                      ? messagedetailOne.corpFixSum
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人固定金额">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.empFixSum == 0 ? (
                                  <span>{messagedetailOne.empFixSum}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.empFixSum ? messagedetailOne.empFixSum : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="企业缴费进位规则">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.corpCarryRuleName == 0 ? (
                                  <span>{messagedetailOne.corpCarryRuleName}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.corpCarryRuleName
                                      ? messagedetailOne.corpCarryRuleName
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="个人缴费进位规则">
                          <span>
                            {messagedetailOne ? (
                              <div>
                                {messagedetailOne.empCarryRuleName == 0 ? (
                                  <span>{messagedetailOne.empCarryRuleName}</span>
                                ) : (
                                  <span>
                                    {messagedetailOne.empCarryRuleName
                                      ? messagedetailOne.empCarryRuleName
                                      : null}
                                  </span>
                                )}
                              </div>
                            ) : null}
                          </span>
                        </FormItem>
                      </Col>
                    </Row>

                    <Row>
                      <Col span={12}>
                        <FormItem {...formItemLayout} label="政府发文时间">
                          {messagedetailOne ? (
                            <span>
                              {messagedetailOne.govPostTime
                                ? moment(messagedetailOne.govPostTime).format('YYYY-MM-DD HH:mm')
                                : null}
                            </span>
                          ) : null}
                        </FormItem>
                      </Col>
                      <Col span={12} />
                    </Row>
                  </Col>
                </Row>
              </div>
            )}

            <Row style={{ textAlign: 'right', marginTop: 40 }}>
              <Button onClick={() => this.isShow()}>关闭</Button>
            </Row>
          </Modal>
        </Spin>
      </Form>
    );
  }
}
export default PolicyDetail;
